/**
 * 
 */
package javapop.framework.parser;

/**
 * @author Hakim Belhaouari
 *
 */
public class WhiteSpace extends Char {

	private static WhiteSpace singleton = new WhiteSpace();
	
	/**
	 * 
	 */
	private WhiteSpace() {
		description = "any whitespace character";
	}
	
	public static WhiteSpace getInstance() {
		return singleton;
	}

	@Override
	public boolean acceptChar(Character ch) {
		if(ch==null)
			return false;
		return Character.isWhitespace(ch);
	}
	
	@Override
	public int hashCode() {
		return id.hashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		return obj==this;
	}

}
